# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fhttp
pkgver=1.3
pkgrel=9
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner' 'blackarch-fuzzer'
        'blackarch-fingerprint' 'blackarch-dos')
pkgdesc='This is a framework for HTTP related attacks. It is written in Perl with a GTK interface, has a proxy for debugging and manipulation, proxy chaining, evasion rules, and more.'
arch=('any')
url='http://packetstormsecurity.com/files/104315/FHTTP-Attack-Tool-1.3.html'
license=('custom:unknown')
depends=('perl' 'perl-io-socket' 'perl-switch')
source=("https://dl.packetstormsecurity.net/UNIX/utilities/$pkgname-v$pkgver-multi-lang.tar.gz")
sha512sums=('e6a9f517ecdcd6615655792a25feaa1e00fb0146028e55d83497d361df53fcacf6917cdfec3febd21279184a65f232b2961ceb8a3284b2c12a50fda1ab0728bc')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  rm "fhttp-v$pkgver-multi-lang.tar.gz"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
export PERL5LIB="/usr/share/$pkgname"
cd /usr/share/$pkgname
exec perl $pkgname.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

